package com.ruoyi.settled.service.impl;

import com.ruoyi.settled.domain.AgreementRule;
import com.ruoyi.settled.mapper.AgreementRuleMapper;
import com.ruoyi.settled.service.IAgreementRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 协议规则Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-30
 */
@Service
public class AgreementRuleServiceImpl implements IAgreementRuleService 
{
    @Autowired
    private AgreementRuleMapper agreementRuleMapper;

    /**
     * 查询协议规则
     * 
     * @param ruleCode 协议规则主键
     * @return 协议规则
     */
    @Override
    public AgreementRule selectAgreementRuleByRuleCode(String ruleCode)
    {
        return agreementRuleMapper.selectAgreementRuleByRuleCode(ruleCode);
    }

    /**
     * 查询协议规则列表
     * 
     * @param agreementRule 协议规则
     * @return 协议规则
     */
    @Override
    public List<AgreementRule> selectAgreementRuleList(AgreementRule agreementRule)
    {
        return agreementRuleMapper.selectAgreementRuleList(agreementRule);
    }

    /**
     * 新增协议规则
     * 
     * @param agreementRule 协议规则
     * @return 结果
     */
    @Override
    public int insertAgreementRule(AgreementRule agreementRule)
    {
        return agreementRuleMapper.insertAgreementRule(agreementRule);
    }

    /**
     * 修改协议规则
     * 
     * @param agreementRule 协议规则
     * @return 结果
     */
    @Override
    public int updateAgreementRule(AgreementRule agreementRule)
    {
        return agreementRuleMapper.updateAgreementRule(agreementRule);
    }

    /**
     * 批量删除协议规则
     * 
     * @param ruleCodes 需要删除的协议规则主键
     * @return 结果
     */
    @Override
    public int deleteAgreementRuleByRuleCodes(String[] ruleCodes)
    {
        return agreementRuleMapper.deleteAgreementRuleByRuleCodes(ruleCodes);
    }

    /**
     * 删除协议规则信息
     * 
     * @param ruleCode 协议规则主键
     * @return 结果
     */
    @Override
    public int deleteAgreementRuleByRuleCode(String ruleCode)
    {
        return agreementRuleMapper.deleteAgreementRuleByRuleCode(ruleCode);
    }


    /**
     * 查询协议规则
     *
     * @param agreementCode 协议规则外键
     * @return 协议规则
     */
    @Override
    public AgreementRule selectAgreementRuleByAgreementCode(String agreementCode){
        return agreementRuleMapper.selectAgreementRuleByAgreementCode(agreementCode);
    };
}
